package online.inote.modules.user.entity;

import java.io.Serializable;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;

import org.hibernate.validator.constraints.Range;

import lombok.Data;
import online.inote.modules.user.valid.UserSave;
import online.inote.modules.user.valid.UserUpdate;

/**
 * <p>
 * Desc: 
 * </p>
 *
 * @author XQF SUI
 * @created 2018年9月10日 上午11:37:53
 * @version 1.0
 */
@Data
public class UserEntity implements Serializable {

	private static final long serialVersionUID = 7101324203653375960L;

	@NotBlank(message = "ID不能为空", groups = UserUpdate.class)
	private String id;
	@NotBlank(message = "姓名不能为空", groups = {UserSave.class, UserUpdate.class})
	private String name;
	@NotNull(message = "年龄不能为空", groups = Default.class)
	@Range(min = 18, max = 60, message = "年龄必须在18~60之间")
	private Integer age;

}